package com.sq.bootshiro.modules.service;

import com.sq.bootshiro.modules.entity.*;
import org.apache.shiro.subject.PrincipalCollection;

import javax.servlet.http.HttpSession;
import java.util.Map;
import java.util.Set;

public interface IShiroService {
    User findUserByUsername(String username);

    User findUserByUserId(String id);

    Set<Role> findRolesByUserId(String userId);

    Set<Permission> findPermissionListByRoleId(String roleId);

    SysToken findSysTokenByToken(String token);

    /**
     * create token by userId
     * @param userId
     * @return
     */
    Map<String,Object> createToken(String username,String password);

    /**
     * 保存用户登录日志
     * @param logUserLogin
     */
    void insertLogUserLogin(LogUserLogin logUserLogin);

    /**
     * logout
     * @param token
     */
    void logout(String token);
}
